	// Loading 读取中
	var Loading=function(selector){
		this.selector=selector;
		this.element=$(selector).get(0);
		if(typeof this.element!="undefined"){
			this.isOpen=true;
		}
	}
	Loading.prototype=new Control();
	
	Loading.prototype.masker=null;
	Loading.prototype.element=null;
	Loading.prototype.tips=null;
	Loading.prototype.wrapper=null;
	Loading.prototype.isOpen=false;
	
	Loading.prototype.create=function(){
		var self=this;
		this.element=document.createElement("div");
		this.element.className="ht-Loading close";
		
		this.tips=document.createElement("p");
		this.tips.innerHTML="请稍候";
		
		this.wrapper=document.createElement("div");
		this.wrapper.className="wrapper";
		this.wrapper.appendChild(this.tips);
		
		this.setId(this.id);
		this.element.appendChild(this.wrapper);
		document.body.appendChild(this.element)
	}
	Loading.prototype.setElement=function(element){
		this.element=element;
		this.isOpen=true;
	}
	Loading.prototype.setMasker=function(masker){
		this.masker=masker;
	}
	Loading.prototype.open=function(){
		if(this.isOpen){
			return false;
		}
		var self=this;
		
		//masker
		if(this.masker==null){
			this.masker=new Masker();
		}else{
			//console.log("masker have");
		}
		this.masker.open()
		
		//loading
		if(this.element==null){
			this.create();
		}else{
			//console.log("loading have");
		}
		$(this.element).show();
		
		
		setTimeout(function(){
			self.element.className="ht-Loading open"
		},0)
		this.isOpen=true;
		return this;
	}
	Loading.prototype.close=function(){
		if(!this.isOpen){
			return false;
		}
		if(this.masker!=null){
			this.masker.close()
		}
		var self=this;
		if(this.element!=null){
			this.element.className="ht-Loading close"
			var timer=setTimeout(function(){
				//self.remove();
				$(self.element).hide();
				self.isOpen=false;
			},500);
		}
	}
	Loading.prototype.hide=function(){
		$(this.element).hide();
		this.masker.hide()
	}
	/*Loading.prototype.remove=function(){
		$(this.element).remove();
		
		//this.element.parentNode.removeChild(this.element)
		this.element=null;
		this.masker=null;
		//document.body.removeChild(this.element)
	}*/
	HTMLTurbo.control.Loading=Loading;